<template>
  <div class="avue-logo" @click="goIndex">
    <img class="logo-img" src="/img/header_logo.png" alt="">
    <!-- <img class="logo-img" src="/img/logo1.png" alt=""> -->
    <transition name="fade">
      <!-- <span v-if="keyCollapse" key="0" class="avue-logo_subtitle" @click="goIndex">
        {{systemName}}
      </span> -->
    </transition>
    <transition-group name="fade">
      <span v-if="!keyCollapse" key="1" class="avue-logo_title" @click="goIndex">
        {{ systemName }}
      </span>
    </transition-group>
  </div>
</template>

<script>
import { mapGetters, mapState } from 'vuex'
export default {
  name: 'Logo',
  computed: {
    ...mapGetters(['website', 'keyCollapse', 'systemName'])
  },
  methods: {
    goIndex: function () {
      // window.location.href = '/'
      this.$router.push( {
        path: '/'
      })
    }
  }
}
</script>

<style lang="scss">
.fade-leave-active {
  transition: opacity 0.2s;
}
.fade-enter-active {
  transition: opacity 2.5s;
}
.fade-enter,
.fade-leave-to {
  opacity: 0;
}
.avue-logo {
  cursor: pointer;
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 60px;
  text-align: center;
  line-height: 60px;
  background-color: #3c70e6;
  font-size: 20px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  color: rgb(255, 255, 255);
  z-index: 1024;
  .logo-img{
    vertical-align: middle;
    width: 38px;
  }
  &_title {
    // display: block;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
  }
  &_subtitle {
    // display: block;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
  }
}
</style>
